package com.csf.service;

import com.csf.annotation.Autowired;
import com.csf.annotation.Component;
import com.csf.entity.User;

/**
 * TODO ADD DESCRIPTION
 * Date: 2018/8/28
 * Time: 16:52
 *
 * @author chenshf
 */
@Component
public class UserService {

    @Autowired
    private User user;

    /**
     * 通过注解注入
     * @return
     */
    public User getUserInfo(){
        getUser().setName("chenshf");
        getUser().setName("123456");
        return user;
    }

    /**
     * 通过xml注入
     * @return
     */
    public User getUserByXml(){
        return user;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
}
